{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "import AsyncDataSetQuery\n",
    "\n",
    "environmentName = 'DEV'\n",
    "\n",
    "query = AsyncDataSetQuery.AsyncDataSetQuery( 'ws://localhost:9000',environmentName)\n",
    "\n",
    "path = 'C:\\\\Earthwave\\\\MountainGlaciers\\\\files'\n",
    "startsWith = 'CS'\n",
    "endsWith = '.nc'\n",
    "columns = ['coh','power']\n",
    "\n",
    "data = await query.validateNetCdf( path, startsWith, endsWith, columns )\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2019-07-12 12:09:03.639343\n",
      "Converter 1277938800.0\n",
      "Converter 1325116800.0\n",
      "{\"envName\": \"DEV\", \"parentDSName\": \"mtngla\", \"dsName\": \"tandemx\", \"bbf\": {\"minX\": 0, \"maxX\": 200000, \"minY\": 0, \"maxY\": 200000, \"minT\": 1277938800.0, \"maxT\": 1325116800.0}, \"projections\": [], \"filters\": []}\n",
      "ws://localhost:9000/query\n",
      "Receiving... /data/puma1/scratch/malard/export/mtngla_tandemx_-641917461.nc [1]\n",
      "2019-07-12 12:09:31.878860\n",
      "['/data/puma1/scratch/malard/export/mtngla_tandemx_-641917461.nc']\n"
     ]
    }
   ],
   "source": [
    "import AsyncDataSetQuery\n",
    "import datetime\n",
    "\n",
    "envName = 'DEV'\n",
    "parentDs = 'mtngla'\n",
    "dataSetName ='tandemx'\n",
    "minX=0\n",
    "maxX=200000\n",
    "minY=0\n",
    "maxY=200000\n",
    "minT=datetime.datetime(2010,7,1,0,0)\n",
    "maxT=datetime.datetime(2011,12,29,0,0)\n",
    "\n",
    "projections = []\n",
    "filters = []\n",
    "\n",
    "print(datetime.datetime.now())\n",
    "filename = await query.executeQuery( parentDs, dataSetName, minX, maxX, minY, maxY, minT, maxT, projections, filters )\n",
    "print(datetime.datetime.now())\n",
    "\n",
    "print(filename)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['/data/puma1/scratch/malard/export/mtngla_tandemx_-641917461.nc']\n"
     ]
    }
   ],
   "source": [
    "print(filename)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
